<template>
    <div>
        <pre>{{ JSON.stringify(obj,0,4) }}</pre>
        <Modal
                v-model="mshow"
                title="高拍仪"
                @on-visible-change="modalChange">

            <wl-equipment
                    file-path="abc"
                    file-name="abcd.png"
                    v-model="obj"
                    :type="type"
                    :is-open="openNow"
                    ref="wlEquipment"
            ></wl-equipment>
        </Modal>
        <Button type="primary" @click="TakePhoto">打开高拍仪</Button>
        <Button type="primary" @click="getIdCardInfo(1)">打开身份证</Button>
        <Button type="primary" @click="getIdCardInfo(2)">打开人脸识别</Button>
    </div>
</template>

<script>
import WlEquipment from '@/components/wl-equipment/index'

export default {
  name: 'device',
  data () {
    return {
      mshow: false,
      openNow: false,
      data: '',
      type: 'heightCamera',
      obj: {}
    }
  },
  components: { WlEquipment },
  methods: {
    TakePhoto () {
      this.mshow = true
      this.openNow = true
    },
    modalChange (e) {
      this.openNow = e
    },
    getIdCardInfo (type) {
      console.log('66666')
      if (type === 1) {
        this.type = 'idcard'
        this.$refs.wlEquipment.getResult()
      }
      if (type === 2) {
        this.type = 'faceCamera'
        this.mshow = true
        this.openNow = true
      }
    },
    wlEquipment () {
      console.log()
    }
  }
}
</script>

<style scoped>

</style>
